// 验证邮箱的规则
let checkEmail = (rule, value, callback) => {
    let regEmail = /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*\.[a-z]{2,}$/;
    if (!regEmail.test(value)) {
        return callback(new Error('请输入合法的邮箱'));
    }
    callback();
};

// 验证手机号的规则
let checkMobile = (rule, value, callback) => {
    let regMobile = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
    if (!regMobile.test(value)) {
        return callback(new Error('请输入合法的手机号'));
    }
    callback();
};
export {
    checkEmail,
    checkMobile
}